Setup dynamic DNS for your Godaddy domain on pfSense routers
My ISP don't provide me with a static IP address, so I need to setup dynamic DNS on my router to be able to reach it from the internet.
The pfSense® software already supports dynamic DNS with Godaddy so this is a short post discussing some of the pitfalls I discovered while trying to set it up.
Getting API credentials from Godaddy #
The dynamic DNS service in the pfSense® software uses the Godaddy API to update your DNS records. To do so it needs to authenticate with credentials for you Godaddy account.
Visit Godaddys developer portal to generate a new set of API credentials. Make sure you set the enviroment to production to actually configure the production DNS service.
Store the credentials somewhere safe, I use a password manager.
Configuring the pfSense® software #
Open your configuration page on your router. In the top toolbar, select Services > Dynamic DNS. Click the +Add button to setup a new dynamic DNS client.
Next you are presented with a form. Lets fill in all the details.
Service type This allows us to select our dynamic DNS provider. In this case we select Godaddy.
Interface to monitor Here you select which interface to read the IP address from. We select the interface used to access the internet, in my case its: WAN.
Hostname
This is split into two fields. The first specifies your sub domain (if you want one). The last field is the domain name which should be set to the domain that you have registered at Godaddy. For instance example.com
. If you want the top level domain example.com
to point to your router, put @
into the first field, and example.com
into the second one. If you want a subdomain to point to your router, specify something like myrouter
into the first field. This will point myrouter.example.com
to your router.
Username Specify the key from your credentials created earlier on Godaddys developer page.
Password This is the secret part of the credentials.
TTL Set your desired time to leave value for the DNS record. Given in seconds. Warning: the minimum value is 600.
Pitfalls #
The biggest pitfall I discovered was when I tried to set TTL to 300. Everything looked correct and configuration page showed a green check mark in the status field for my configuration. However, when I enabled verbose logging and looked at the logs I discovered a error message telling me the TTL needed to be adjusted to a minimum of 600 seconds. This value is probably different for other services making it hard for the pfSense® software to validate the value when put into the form. But I'm still surprised that is marked the status as OK, even if the update request to Godaddy failed.
The other problem I had was basically to discover how to use a top level domain directly without a subdomain. I first tried leaving the first field blank. That didn't work. After some googling and reading the form instructions carefully I learned that I needed to put @
into the hostname field.
- Previous: How ROS Timers work
- Next: Create a state machine in Home Assistant